<template>
  <div > 
    <i class="iconfont icon-menu" @click="toggleClick" :class="iconClass"></i>
  </div>
</template>

<script>
export default {
  name: 'hamburger',
  props: {
    isActive: {
      type: Boolean,
      default: false
    },
    toggleClick: {
      type: Function,
      default: null
    }
  },
  computed: {
    iconClass() {
      return this.isActive ? 'is-active' : 'not-active'
    }
  }
}
</script>

<style lang="scss" scoped>
.not-active {
  display: inline-block;
  transform: rotate(90deg);
  transition: 0.2s;
  color:#fff;
  font-size: 20px;
  &:before {
    cursor: pointer;
  }
}

.is-active {
  display: inline-block;
  transform: rotate(0deg);
  transition: 0.2s;
  color:#fff;
  font-size: 20px;
  &:before {
    cursor: pointer;
  }
}
</style>
